import request from '@/utils/request'

// 查询患者可下拉选择并添加/删除列表
export function listAuthorization(query) {
  return request({
    url: '/system/authorization/list',
    method: 'get',
    params: query
  })
}

// 查询患者可下拉选择并添加/删除详细
export function getAuthorization(patientPhone) {
  return request({
    url: '/system/authorization/' + patientPhone,
    method: 'get'
  })
}

// 新增患者可下拉选择并添加/删除
export function addAuthorization(data) {
  return request({
    url: '/system/authorization',
    method: 'post',
    data: data
  })
}

// 修改患者可下拉选择并添加/删除
export function updateAuthorization(data) {
  return request({
    url: '/system/authorization',
    method: 'put',
    data: data
  })
}

// 删除患者可下拉选择并添加/删除
export function delAuthorization(patientPhone) {
  return request({
    url: '/system/authorization/' + patientPhone,
    method: 'delete'
  })
}
//查询所有科室
export function listDepartments(query) {
  return request({
    url: '/system/departments/list',
    method: 'get',
    params: query
  })
}

//查询所有患者 --被绑定的患者就不允许出现添加里面
export function listPatients(query) {
  return request({
    url: '/system/patients/list',
    method: 'get',
    params: query
  })
}
